<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>投票页面</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div>
    <button onclick="addRecords()">【投票】</button><br>
    <input hidden="hidden" id="id" value="${tbVote.id}">
    <input hidden="hidden" id="token" value="${tbVote.token}">
    姓名：<input type="text" value="${tbVote.name}"><br>
    籍贯：<input type="text" value="${tbVote.nativePlace}"><br>
    生日：<input type="text" value="${tbVote.birthTime}"><br>
    照片：<img src="${tbVote.photo}" width="100px" height="100px"/><br>
    <span>简介视频：</span>
    <video src="${tbVote.video}" width="500px" height="500px" controls autoplay/><br>
</div>
</body>
<script type="text/javascript"></script>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
    function addRecords(){
        let id = $("#id").val();
        let token = $("#token").val();

        $.ajax({
            url:"http://localhost:10010/vote/vote/addRecord/"+id+"/"+token,
            data:null,
            contentType:"application/json;charset=utf-8",
            dataType:"json",
            type:"post",
            async:false,
            success:function (result){
                console.log(result)
                alert(result.data.msg);
                location.href="http://localhost:5173/vote"
            },
            error:function (c){
                console.log(c);
            }
        })
    }

</script>
</html>